UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JoGXjT1SwO6MivSwI4YRZjChBd2fVxDT76DgDpy/JXo=' 
WHERE 
  key_id = 'd2506ba0135ef6f22e935a53708ca871fcaef2483f83128c667257c878752976' 
  AND (
    token = 'JoGXjT1SwO6MivSwI4YRZjChBd2fVxDT76DgDpy/JXo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034