UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3+2qmJBNiw+nThI29JFGlDOSP0fbn2EdUEeMdSnD2DA=' 
WHERE 
  key_id = '5b285a445eab152fa5166219f788c79ca67c26abd5923a8900a0757a6f415fd7' 
  AND (
    token = '3+2qmJBNiw+nThI29JFGlDOSP0fbn2EdUEeMdSnD2DA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055