UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tCrYod+DytCGpI2VERP/J+egOWr+fyJMMQwEqrIqsjY='
WHERE
key_id = '68e78705eaf5ddf9ff4fa2a16e86f608dcda2c5fe0802d05ed9fdd2fbb484877'
AND (
token = 'tCrYod+DytCGpI2VERP/J+egOWr+fyJMMQwEqrIqsjY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)