UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'csnYLQqMWlB9gWOFAef1b2HmKJRSKj18mTIY/2rFHrs='
WHERE
key_id = '0203d6c2c3e97cdeed00d47b48f948663f9b9b75e7437a21a8c58feec71dc6db'
AND (
token = 'csnYLQqMWlB9gWOFAef1b2HmKJRSKj18mTIY/2rFHrs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)