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