UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '64o5Iv1vXJ8BWtQ+5u25Fj5jKeSROOVTxeFAo3uX6CY='
WHERE
key_id = '8855a3f3c11275402b0fbcb078d52bdf7afc37fe45cd0df6a215d92855381da3'
AND (
token = '64o5Iv1vXJ8BWtQ+5u25Fj5jKeSROOVTxeFAo3uX6CY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)