UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KYDVk7hAI/sX0SZB1T3HJQMwXZt1CZd6MA4vrF9vMtw='
WHERE
key_id = '568d0b383ceec6bf1797143ca22f0a11a08b45e9fde5487a1c9ad8fbfe8485ff'
AND (
token = 'KYDVk7hAI/sX0SZB1T3HJQMwXZt1CZd6MA4vrF9vMtw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)