UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u6wa6xqVkB1I2kpkj/swoMFt9MDs3S/0OEoWSUgnsKs='
WHERE
key_id = 'd6c8764dbaf83a5766b67be3888b73741f0dfa1ae6cca9b273b702f71b06a2f3'
AND (
token = 'u6wa6xqVkB1I2kpkj/swoMFt9MDs3S/0OEoWSUgnsKs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)