UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BNsbeXm2bNETPKxkc8i0eKPShhCvcBm2NQN4JK3kLe0='
WHERE
key_id = '941e51296ca5f80129ddfc890faf184451c5ad9c183bde3c9eb969c779584645'
AND (
token = 'BNsbeXm2bNETPKxkc8i0eKPShhCvcBm2NQN4JK3kLe0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)