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