UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+fbp9fZwz2Zyo/jX01j+b6ddoK9OWjiKpFFpLsIk0kw='
WHERE
key_id = 'f25fc86d2894ee723bbf984494356bf8d9fb42f12c277cf3d006ea867a5d5a0b'
AND (
token = '+fbp9fZwz2Zyo/jX01j+b6ddoK9OWjiKpFFpLsIk0kw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)