UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zoILMePjbpE+6l0HexkVuUhfmC4PmldQa3Sx7m5NkUk=' 
WHERE 
  key_id = 'eee7225bc81b90a42565a108e61ce3ab0013c8f2e19487c3d4cc4813aabe1171' 
  AND (
    token = 'zoILMePjbpE+6l0HexkVuUhfmC4PmldQa3Sx7m5NkUk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043