UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2CmKdMTEAHVVq5oTFKlFiCSAtVTV6P/2Nzjb1kgRMfA='
WHERE
key_id = 'a290a09412c493cb740e3d7edc4bcfffdc76f80bb70597365c87a8267f960c3a'
AND (
token = '2CmKdMTEAHVVq5oTFKlFiCSAtVTV6P/2Nzjb1kgRMfA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)