UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B9TTHhwmSswz1x7XNFpQWocZa5nfhj3Q4egforR0OJM='
WHERE
key_id = '8084acb8d5434295aa0475b077def80f0aa9c43bca5f8f407230a4c4f94c7e0b'
AND (
token = 'B9TTHhwmSswz1x7XNFpQWocZa5nfhj3Q4egforR0OJM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)