UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K1qfATpVDfFmLBP45Yh8BnE1EZ3J2SmxrKe5qz2uI2k='
WHERE
key_id = '74a21e792fb77780f989d79d0a0605644e1502fe96239fdea8a8def842516f23'
AND (
token = 'K1qfATpVDfFmLBP45Yh8BnE1EZ3J2SmxrKe5qz2uI2k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)