UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TnwvjdusqPWmyWicfyfEFDx8sxvcKHQrp2iuKx7+p7Q='
WHERE
key_id = '6b43af112fb3f82414c07f9335675ff08aaae3ddcd9596c4f847896c94733ec3'
AND (
token = 'TnwvjdusqPWmyWicfyfEFDx8sxvcKHQrp2iuKx7+p7Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)