UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'axvpK/sbvqzALoGvi0M2QDqjfRNgvZqmXEMdlCPP39Y='
WHERE
key_id = 'ea89fc42b1702008d7ab6c5c65dd5b7344a016226e74fca7633a2b0d133db0cf'
AND (
token = 'axvpK/sbvqzALoGvi0M2QDqjfRNgvZqmXEMdlCPP39Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)