UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aL4uh8N1lLHF+Qj/R1FISCxXn7nrYmLpMvSBP7CofA0='
WHERE
key_id = 'f315b6bdcdfe5f176af37cc85d11d22a1593e21c07be9c4d372a4091b4b69585'
AND (
token = 'aL4uh8N1lLHF+Qj/R1FISCxXn7nrYmLpMvSBP7CofA0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)