UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4EWp0K24AILhFV0DfdRZ2NOag73N+hjvjysyYGV9OrU='
WHERE
key_id = 'd37b84bcdb90a3132babcac00b4422a41cc7e9292cdc624039db768d829620b4'
AND (
token = '4EWp0K24AILhFV0DfdRZ2NOag73N+hjvjysyYGV9OrU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)