UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JLAvJFileW3iH36yHr/ZCv+HSuTa3a8B7k0oJz0YtwY='
WHERE
key_id = 'ea380af65cb6594e7b3e57516cfed863718345a5378f479d85fea299f45c5884'
AND (
token = 'JLAvJFileW3iH36yHr/ZCv+HSuTa3a8B7k0oJz0YtwY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)