UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vkBiCFqXJ9dHj1rJ1Gx9r1UxLEXP7pTvYBjjHS02+bc='
WHERE
key_id = 'a594df06e91da39e89bd7f5d593055ecfd6cf4c1008653b25331c48b10f6225a'
AND (
token = 'vkBiCFqXJ9dHj1rJ1Gx9r1UxLEXP7pTvYBjjHS02+bc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)