UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CQpFPJ0JdlvRRFB/q94GuPhupAdIadsXTI4L/L86/UY='
WHERE
key_id = 'f9c90f9739b11bad0612b32f5a7c7b041ce32c72878a411f22241ec31df427e5'
AND (
token = 'CQpFPJ0JdlvRRFB/q94GuPhupAdIadsXTI4L/L86/UY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)