UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SkV5lijMOv5fGLT1RcycFSedL3spiZtB7ZoDjTeBqV8='
WHERE
key_id = 'c8b111de75dfedb3e2f4a90dc0e0242dd8a89c6a710ad78246f4df10c110dc4c'
AND (
token = 'SkV5lijMOv5fGLT1RcycFSedL3spiZtB7ZoDjTeBqV8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)