UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y98H9Cn1HWNk2B9saqrx0Al8ZkpUOUmDXhAN8+gKsWI=' 
WHERE 
  key_id = 'bd3ff17cb3ed54e6415494e1f73f92c960109e4008d98aa33a1842ab311a1b82' 
  AND (
    token = 'y98H9Cn1HWNk2B9saqrx0Al8ZkpUOUmDXhAN8+gKsWI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029