UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lHaXOyFSas4h+EgW5aoiLHxLW0hgjR3Y/K1oov/TG+8='
WHERE
key_id = 'd6be97ea59fe8fafc791f36350e012e4a26bf3a1a0574644f23e2b5cf465f5e7'
AND (
token = 'lHaXOyFSas4h+EgW5aoiLHxLW0hgjR3Y/K1oov/TG+8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)