UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZMuxQ/JYCuSrv5nJB2hBsd9f9amw67pk96dQaIiQCG4=' 
WHERE 
  key_id = 'ff01bd87551ff8af0055ff1bb69598744bfc59841693fbd00353c42521b6e9aa' 
  AND (
    token = 'ZMuxQ/JYCuSrv5nJB2hBsd9f9amw67pk96dQaIiQCG4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027