UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vnYX8mLtO2zYXSBZq7UYMrYJAzd3uxPfQvHueMGutKM='
WHERE
key_id = '345f6d210e2d65496501c8d71c6ffc3aa27a1f73319aa365c7cdadce8ae092ec'
AND (
token = 'vnYX8mLtO2zYXSBZq7UYMrYJAzd3uxPfQvHueMGutKM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)