UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OjHSAUZ6uNkLzIaN6Te3UrF/SSxX04NOtuqU/DEHr9M='
WHERE
key_id = 'f16b646976e44e9b436ae42336df1269c6c47bff19c9ef8522b7ab99783959e7'
AND (
token = 'OjHSAUZ6uNkLzIaN6Te3UrF/SSxX04NOtuqU/DEHr9M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)