UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CzzzHqfAHTXJHpp2v4BM/Y63Ef7WvBJRXhcVg/CR8vU=' 
WHERE 
  key_id = 'd89b05aa382afae534c82aa50b5c7830893b19acb4dc7a2d07d11daa9612e023' 
  AND (
    token = 'CzzzHqfAHTXJHpp2v4BM/Y63Ef7WvBJRXhcVg/CR8vU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023