UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VQOFYlDnGreG5g06BOD6Q1UkZNuNddIAkL57JvKL3xA='
WHERE
key_id = 'ad44a9bde79f80c37a3bbf98b14efad60bf47dfd0b55f4839220018f13191680'
AND (
token = 'VQOFYlDnGreG5g06BOD6Q1UkZNuNddIAkL57JvKL3xA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)