UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N6q/P2YEpJ2nQpMJFfEvqdRae4GdCj5v9gVo0rJMlkE=' 
WHERE 
  key_id = '6af4840ead5b05e1b0adc75e038093490aa9362ec6e7a1eddae7d4b44e941732' 
  AND (
    token = 'N6q/P2YEpJ2nQpMJFfEvqdRae4GdCj5v9gVo0rJMlkE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029